package com.example.demo.vo

import com.example.demo.dbmodels.TRoom
import java.time.LocalDateTime

class RoomVo {

    /**
     *  房间id
     **/
    var id: Int?= null
    /**
     *  病区代码
     **/
    var district_code: String?= null
    /**
     *  科室代码
     **/
    var dept_code: String?= null
    /**
     *  房间编码
     **/
    var code: String?= null
    /**
     *  房间名称
     **/
    var name: String?= null
    /**
     *  位置
     **/
    var position: String?= null
    /**
     *  负责人ID
     **/
    var duty_by: Int?= null
    /**
     *  排序
     **/
    var sort: Int?= null
    /**
     *  状态1=有效，0=无效
     **/
    var status: Int?= null
    /**
     *  备注
     **/
    var remark: String? = null
    /**
     *  更新时间
     **/
    var update_time: LocalDateTime? = null
    /**
     *  更新人
     **/
    var update_by: Int?= null
    /**
     *  删除标记
     **/
    var is_del: Boolean?= null
    /**
     *  责任医生
     **/
    var doctor_code: String? = null
    /**
     *  责任护士
     **/
    var nurse_code: String? = null


    fun getListRoomVo(table:List<TRoom>):List<RoomVo>{
        table?.let {
            val roomLabelVo = mutableListOf<RoomVo>()
            table.forEach {
                val data = RoomVo()
                data.code = it.code
                data.dept_code = it.dept_code
                data.district_code = it.district_code
                data.doctor_code = it.doctor_code
                data.duty_by = it.duty_by
                data.id = it.id
                data.is_del = it.is_del
                data.name = it.name
                data.nurse_code = it.nurse_code
                data.position = it.position
                data.remark = it.remark
                data.sort = it.sort
                data.status = it.status
                data.update_by = it.update_by
                data.update_time = it.update_time
                roomLabelVo.add(data)
            }
            return  roomLabelVo
        }
    }

}